<%--
  Created by IntelliJ IDEA.
  User: lixiaodong
  Date: 2018/3/26
  Time: 17:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div id="department_message_div">
    <fieldset class="layui-elem-field">
        <legend>部门信息</legend>
        <form id="department_message_departmentForm">
            <input type="hidden" id="department_message_department_id" name="department.id">
            <table class="table1" style="width: 100%">
                <tr>
                    <th>部门名称：</th>
                    <td>
                        <input id="department_message_department_name" class="easyui-textbox" name="department.name" data-options="required:true">
                    </td>
                    <th>部门编号：</th>
                    <td>
                        <input id="department_message_department_number" class="easyui-textbox" name="department.number" data-options="required:true">
                    </td>
                </tr>
                <tr>
                    <th>上级部门：</th>
                    <td>
                        <input id="department_message_department_superior" class="easyui-textbox" name="superiorName" data-options="required:false">
                    </td>
                    <th>状态：</th>
                    <td>
                        <input id="department_message_department_state" class="easyui-textbox" name="department.state" data-options="required:false">
                    </td>
                </tr>
                <tr>
                    <th>部门介绍：</th>
                    <td colspan="3">
                        <input id="department_message_department_introduce" class="easyui-textbox" name="department.introduce" data-options="required:false" style="width: 700px;">
                    </td>
                </tr>
            </table>
        </form>
    </fieldset>
    <fieldset class="layui-elem-field">
        <legend>部长信息</legend>
        <form id="department_message_leaderForm">
            <input type="hidden" id="department_message_leader_id" name="member.id">
            <table class="table1" style="width: 100%;">
                <tr>
                    <th>姓名：</th>
                    <td>
                        <input id="department_message_leader_name" class="easyui-textbox" name="member.name" data-options="readonly:true">
                    </td>
                    <th>性别：
                    </th>
                    <td>
                        <select id="department_message_leader_sex" class="easyui-combobox" name="member.sex" data-options="readonly:true,editable:false">
                            <option value="男">男</option>
                            <option value="女">女</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <th>部员编号：</th>
                    <td>
                        <input id="department_message_leader_number" class="easyui-textbox" name="member.number" data-options="readonly:true">
                    </td>
                    <th>电话：</th>
                    <td>
                        <input id="department_message_leader_phone" class="easyui-textbox" name="member.phone" data-options="readonly:true">
                    </td>
                </tr>
                <tr>
                    <th>QQ号：</th>
                    <td>
                        <input id="department_message_leader_qq" class="easyui-textbox" name="member.qq" data-options="readonly:true">
                    </td>
                    <th>邮箱：</th>
                    <td>
                        <input id="department_message_leader_email" class="easyui-textbox" name="member.email" data-options="readonly:true">
                    </td>
                </tr>
                <tr>
                    <th>状态：</th>
                    <td>
                        <input id="department_message_leader_state" class="easyui-textbox" name="member.state" data-options="readonly:true">
                    </td>
                </tr>
            </table>
        </form>
    </fieldset>
</div>

<script type="text/javascript">
    var _department_message_js = {
        init : function () {
            var _row = _department_info_js._qp.row;
            $('#department_message_department_id').val(_row.id);
            $('#department_message_department_name').textbox('setValue',_row.name);
            $('#department_message_department_number').textbox('setValue',_row.number);
            $('#department_message_department_state').textbox('setValue',_row.state);
            $('#department_message_department_introduce').textbox('setValue',_row.introduce);
            if (_row.superior != null){
                $('#department_message_department_superior').textbox('setValue',_row.superior.name);
            }
            if (_row.leader != null){
                $('#department_message_leader_id').val(_row.leader.id);
                $('#department_message_leader_name').textbox('setValue',_row.leader.name);
                $('#department_message_leader_number').textbox('setValue',_row.leader.number);
                $('#department_message_leader_state').textbox('setValue',_row.leader.state);
                if (_row.leader.person != null){
                    $('#department_message_leader_phone').textbox('setValue',_row.leader.person.phone);
                    $('#department_message_leader_qq').textbox('setValue',_row.leader.person.qq);
                    $('#department_message_leader_email').textbox('setValue',_row.leader.person.email);
                    $("#department_message_leader_sex").combobox('select',_row.leader.person.sex==null? '男':_row.leader.person.sex);
                }
            }
        }
    }

    var classes_message_app = (function () {
        $(function () {
            _department_message_js.init();
        });
    })();
</script>